package com.mlz.mlzmall.ui.activity.act.personal.userLogin;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.mlz.mlzmall.ui.utils.DataUtils;

import java.io.Serializable;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/2/1.
 */
public class WeiBoUser implements Serializable {


    /**
     * id : 5546531147
     * idstr : 5546531147
     * screen_name : ying_saiya
     * name : ying_saiya
     * province : 44
     * city : 3
     * location : 广东 深圳
     * profile_image_url : http://tp4.sinaimg.cn/5546531147/50/5749028181/1
     * cover_image_phone : http://ww1.sinaimg.cn/crop.0.0.640.640.640/549d0121tw1egm1kjly3jj20hs0hsq4f.jpg
     * profile_url : u/5546531147
     * followers_count : 9
     * friends_count : 43
     * pagefriends_count : 0
     * statuses_count : 43
     * favourites_count : 105
     * following : false
     * allow_all_act_msg : false
     * source_allowclick : 0
     * source_type : 1
     * favorited : false
     * truncated : false
     * online_status : 0
     * bi_followers_count : 4
     */

    private long id;
    private String idstr;
    private String screen_name;
    private String name;
    private String province;
    private String city;
    private String location;
    private String profile_image_url;
    private String cover_image_phone;
    private String profile_url;
    private int followers_count;
    private int friends_count;
    private int pagefriends_count;
    private int statuses_count;
    private int favourites_count;
    private boolean following;
    private boolean allow_all_act_msg;
    private int source_allowclick;
    private int source_type;
    private boolean favorited;
    private boolean truncated;
    private int online_status;
    private int bi_followers_count;

    public int getGender() {
        return DataUtils.getInt(gender.equals("m") ? 1 : 2);
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    private String gender;

    public String getAvatar_large() {
        return DataUtils.getString(avatar_large);
    }

    public void setAvatar_large(String avatar_large) {
        this.avatar_large = avatar_large;
    }

    public String getAvatar_hd() {
        return DataUtils.getString(avatar_hd);
    }

    public void setAvatar_hd(String avatar_hd) {
        this.avatar_hd = avatar_hd;
    }

    private String avatar_large;
    private String avatar_hd;


    public static WeiBoUser objectFromData(String str) {

        return new Gson().fromJson(str, WeiBoUser.class);
    }

    public static List<WeiBoUser> arrayWeiBoUserFromData(String str) {

        Type listType = new TypeToken<ArrayList<WeiBoUser>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public void setId(long id) {
        this.id = id;
    }

    public void setIdstr(String idstr) {
        this.idstr = idstr;
    }

    public void setScreen_name(String screen_name) {
        this.screen_name = screen_name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public void setProfile_image_url(String profile_image_url) {
        this.profile_image_url = profile_image_url;
    }

    public void setCover_image_phone(String cover_image_phone) {
        this.cover_image_phone = cover_image_phone;
    }

    public void setProfile_url(String profile_url) {
        this.profile_url = profile_url;
    }

    public void setFollowers_count(int followers_count) {
        this.followers_count = followers_count;
    }

    public void setFriends_count(int friends_count) {
        this.friends_count = friends_count;
    }

    public void setPagefriends_count(int pagefriends_count) {
        this.pagefriends_count = pagefriends_count;
    }

    public void setStatuses_count(int statuses_count) {
        this.statuses_count = statuses_count;
    }

    public void setFavourites_count(int favourites_count) {
        this.favourites_count = favourites_count;
    }

    public void setFollowing(boolean following) {
        this.following = following;
    }

    public void setAllow_all_act_msg(boolean allow_all_act_msg) {
        this.allow_all_act_msg = allow_all_act_msg;
    }

    public void setSource_allowclick(int source_allowclick) {
        this.source_allowclick = source_allowclick;
    }

    public void setSource_type(int source_type) {
        this.source_type = source_type;
    }

    public void setFavorited(boolean favorited) {
        this.favorited = favorited;
    }

    public void setTruncated(boolean truncated) {
        this.truncated = truncated;
    }

    public void setOnline_status(int online_status) {
        this.online_status = online_status;
    }

    public void setBi_followers_count(int bi_followers_count) {
        this.bi_followers_count = bi_followers_count;
    }

    public long getId() {
        return id;
    }

    public String getIdstr() {
        return DataUtils.getString(idstr);
    }

    public String getScreen_name() {
        return DataUtils.getString(screen_name);
    }

    public String getName() {
        return DataUtils.getString(name);
    }

    public String getProvince() {
        return DataUtils.getString(province);
    }

    public String getCity() {
        return DataUtils.getString(city);
    }

    public String getLocation() {
        return DataUtils.getString(location);
    }

    public String getProfile_image_url() {
        return DataUtils.getString(profile_image_url);
    }

    public String getCover_image_phone() {
        return DataUtils.getString(cover_image_phone);
    }

    public String getProfile_url() {
        return DataUtils.getString(profile_url);
    }

    public int getFollowers_count() {
        return DataUtils.getInt(followers_count);
    }

    public int getFriends_count() {
        return DataUtils.getInt(friends_count);
    }

    public int getPagefriends_count() {
        return DataUtils.getInt(pagefriends_count);
    }

    public int getStatuses_count() {
        return DataUtils.getInt(statuses_count);
    }

    public int getFavourites_count() {
        return DataUtils.getInt(favourites_count);
    }

    public boolean getFollowing() {
        return following;
    }

    public boolean getAllow_all_act_msg() {
        return allow_all_act_msg;
    }

    public int getSource_allowclick() {
        return DataUtils.getInt(source_allowclick);
    }

    public int getSource_type() {
        return DataUtils.getInt(source_type);
    }

    public boolean getFavorited() {
        return favorited;
    }

    public boolean getTruncated() {
        return truncated;
    }

    public int getOnline_status() {
        return DataUtils.getInt(online_status);
    }

    public int getBi_followers_count() {
        return DataUtils.getInt(bi_followers_count);
    }
}
